﻿@{
    Layout = null;
}
<script src="~/Scripts/MGJJS/CodeManage/CodeBatch.js"></script>
<link href="~/Scripts/Bootstrap/css/bootstrap-datepicker3.min.css" rel="stylesheet" />
<script src="~/Scripts/Bootstrap/js/bootstrap-datepicker.js"></script>

<script>
    function showPanel(obj) {
        $(obj).parent().parent().nextAll('.panel-collapse').toggle();
    }
</script>
@*生码批次*@
<div class="mtlr15">
    <form id="SearchForm" role="form" onkeydown="if(event.keyCode==13){return false;}">
        <div class="row">
            <div class="col-lg-8 col-md-8 col-sm-8" style="padding:0"> </div>
            <div class="col-lg-4 col-md-4 col-sm-4">
                <div class="input-group">
                    <div style="width:100%;display:none"></div>
                    <input type="text" class="form-control" placeholder="生码批次" id="Batch" name="Batch" onkeydown="if (event.keyCode == 13) { $.MGJ.CodeBatch.Ajax_CodeBatchPageList(1); }" />
                    <span class="input-group-addon" onclick="$.MGJ.CodeBatch.Ajax_CodeBatchPageList(1);">
                        <span class="glyphicon glyphicon-search"></span>
                    </span>
                    <div class="input-group-btn" style="margin-left:1px;" onclick="detailSearch(this)">
                        <button type="button" class="btn btn-default" style="border: 1px solid transparent;">
                            更多搜索
                            <span class="caret"></span>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <div class="detail-search-con" style="display:none">
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    开始时间
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input id="StartDate" type="text" name="StartDate" class="form-control" placeholder="开始时间" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    结束时间
                </div>

                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-3">
                    <input id="EndDate" type="text" name="EndDate" class="form-control" placeholder="结束时间" />
                </div>

            </div>
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    机构名称
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input type="text" name="EnterpriseName" class="form-control" placeholder="机构名称" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    关联产品
                </div>

                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2">
                    <input type="text" name="ProductName" class="form-control" placeholder="关联产品" />
                </div>

                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2 text-center">
                    <button type="button" class="btn btn-default" style="margin-left:23px;" onclick="$.MGJ.CodeBatch.Ajax_CodeBatchPageList(1)">
                        <span class="glyphicon glyphicon-search"></span>
                        搜索
                    </button>
                    <button type="reset" class="btn btn-default">
                        重置
                    </button>
                </div>
            </div>
        </div>

    </form>
    @*<table class="table table-hover table-bordered" style="text-align:center">
        <thead>
            <tr>
                <th width="15"><input type="checkbox" class="AllClickCheckbox"></th>
                <th>生码批次</th>
                <th>生码数量</th>
                <th style="max-width:100px;">机构名称</th>
                <th>标签类型</th>
                <th>状态</th>
                <th>关联产品</th>
                <th>产品批次</th>
                <th style="max-width:100px;">创建时间</th>
                <th style="max-width:100px;">最后更新时间</th>
                <th>操作</th>

            </tr>
        </thead>
        <tbody id="CodeBatchTable" style="display:none;" binding="{'pageId':'CodeBatchPager','pageCallback':'$.MGJ.CodeBatch.Ajax_CodeBatchPageList','emptyHtml':BID_EmptyHtml}">
            <tr>
                <td width="15"><input type="checkbox" class="AllClickChild"></td>
                <td binding="{'text':'Batch'}"></td>
                <td binding="{'text':'Gen_Code_Nums'}"></td>
                <td style="max-width:100px;" binding="{'text':'EnterpriseName','title':'EnterpriseName'}"></td>
                <td binding="{'text':'CodeType','textHandle':$.MGJ.CodeBatch.Ajax_hander}"></td>
                <td binding="{'text':'Status','textHandle':$.MGJ.CodeBatch.Ajax_InitStatu}"></td>
                <td binding="{'text':'ProductName'}"></td>
                <td binding="{'text':'BatchName'}"></td>
                <td style="max-width:100px;" binding="{'text':'CreateDate','textHandle':'datetime','title':'CreateDate','titleHandle':'datetime'}"></td>
                <td style="max-width:100px;" binding="{'text':'ChangeDate','textHandle':'datetime','title':'ChangeDate','titleHandle':'datetime'}"></td>
                <td>
                    <a class="limitUpd" binding="{'BID':'BID','Eid':'EnterpriseId'}" onclick="$.MGJ.CodeBatch.Dialog_EditBatch(this)">编辑</a>
                    <a class="limitUpd" binding="{'CID':'ID'}" onclick="$.MGJ.CodeBatch.Ajax_DelCodeBatch(this)">删除</a>
                </td>
            </tr>
        </tbody>

    </table>
    <div id="CodeBatchPager"></div>*@

    <div id="wh100">
        <div class="fixed-table">
            <div id="over">
                <div class="fixed-table-left">
                    <table>
                        <thead>
                            <tr style="height:36px;">
                                <th>生码批次</th>
                            </tr>
                        </thead>
                        <tbody id="CodeBatchTable_left" style="display:none;" binding="{'pageId':'CodeBatchPager','pageCallback':'$.MGJ.CodeBatch.Ajax_CodeBatchPageList'}">
                            <tr style="height:36px;">
                                <td binding="{'text':'Batch'}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-middle" style="width:100%;">
                    <table style="width:100%;">
                        <thead>
                            <tr style="height:36px;">
                                <th>生码批次</th>
                                <th>生码数量</th>
                                <th>机构名称</th>
                                <th>标签类型</th>
                                <th>状态</th>
                                <th>是否启用</th>
                                <th>关联产品</th>
                                <th>产品批次</th>
                                <th>创建时间</th>
                                <th>最后更新时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="CodeBatchTable" style="display:none;" binding="{'pageId':'CodeBatchPager','pageCallback':'$.MGJ.CodeBatch.Ajax_CodeBatchPageList','emptyHtml':BID_EmptyHtml}">
                            <tr style="height:36px;">
                                <td binding="{'text':'Batch'}"> </td>
                                <td binding="{'text':'Gen_Code_Nums'}"></td>
                                <td binding="{'text':'EnterpriseName','title':'EnterpriseName'}"></td>
                                <td binding="{'text':'CodeType','textHandle':$.MGJ.CodeBatch.Ajax_hander}"></td>
                                <td binding="{'text':'Status','textHandle':$.MGJ.CodeBatch.Ajax_InitStatu}"></td>
                                <td class="ViewFlag" binding="{'text':'ViewFlag','textHandle':$.MGJ.CodeBatch.Ajax_ViewFlag}"></td>
                                <td binding="{'text':'ProductName'}"></td>
                                <td binding="{'text':'BatchName'}"></td>
                                <td binding="{'text':'CreateDate','textHandle':'datetime','title':'CreateDate','titleHandle':'datetime'}"></td>
                                <td binding="{'text':'ChangeDate','textHandle':'datetime','title':'ChangeDate','titleHandle':'datetime'}"></td>
                                <td>
                                    <a>查看</a>
                                    @*<a>删除</a>*@
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-right">
                    <table>
                        <thead>
                            <tr>
                                <th style="padding:6px 15px 7px;">操作</th>
                            </tr>
                        </thead>
                        <tbody id="CodeBatchTable_right" style="display:none;" binding="{'pageId':'CodeBatchPager','pageCallback':'$.MGJ.CodeBatch.Ajax_CodeBatchPageList'}">
                            <tr>
                                <td style="padding:6px 15px 7px;">
                                    <a class="limitUpd" binding="{'BID':'BID','Eid':'EnterpriseId'}" onclick="$.MGJ.CodeBatch.Dialog_EditBatch(this)">查看</a>
                                    @*<a class="limitUpd" binding="{'CID':'ID'}" onclick="$.MGJ.CodeBatch.Ajax_DelCodeBatch(this)">删除</a>*@
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="CodeBatchPager"></div>
        </div>
    </div>
</div>

<script>
    $("#StartDate").datepicker({
        format: "yyyy-mm-dd",
        language: 'cn',
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        endDate: new Date()
    }).on('changeDate', function (e) {
        var startTime = e.date;
        $('#EndDate').datepicker('setStartDate', startTime);
    });
    $("#EndDate").datepicker({
        format: "yyyy-mm-dd",
        language: 'cn',
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        endDate: new Date()
    }).on('changeDate', function (e) {
        var endTime = e.date;
        $('#StartDate').datepicker('setEndDate', endTime);
    });

    var ColspanNub = $(".fixed-table-middle").find("tr").children("td").length
    window.BID_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';

    $(function () {
        $.MGJ.CodeBatch.Ajax_CodeBatchPageList(1);
    })

    $('#SearchForm').bootstrapValidator({
        fields: {
            EnterpriseName: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '机构名称不能输入符号'
                    }
                }
            },
            ProductName: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '关联产品不能输入符号'
                    }
                }
            }
        }
    })
</script>



